import Vue from 'vue';
import iView from 'iview';
import { router } from './router/index';
import store from './store';
import App from './app.vue';
import util from '@/libs/util.js';
import hasPermission from '@/libs/hasPermission.js';
import axios from './libs/axios';
import modal from '@/views/main-components/modal/modal.vue';
import modalModal from '@/views/main-components/modal/modal-modal.vue';
import 'iview/dist/styles/iview.css';


Vue.use(iView);
Vue.use(hasPermission);

Vue.prototype.$axios = axios;
Vue.prototype.bus = new Vue();
Vue.component('modal', modal);
Vue.component('modalModal', modalModal);

new Vue({
    el: '#app',
    router: router,
    store: store,
    render: h => h(App),
    mounted () {
        // 调用方法，动态生成路由
        util.initRouter(this);
    }
});
